﻿using System.Collections.Generic;
using System.Linq;

namespace Trentacular.SharePoint.Deployment.Model
{
    public abstract class BaseFeatureContainer<TFeature, TSelf> : NamedEntity, IFeatureContainer<TFeature, TSelf>
        where TFeature : IFeature<TSelf, TFeature>
        where TSelf : BaseFeatureContainer<TFeature, TSelf>
    {
        #region IFeatureContainer<TFeature,TSelf> Members

        public abstract IList<TFeature> Features { get; set; }

        #endregion

        #region IFeatureContainer Members

        IList<IFeature> IFeatureContainer.Features
        {
            get
            {
                return Features.Cast<IFeature>().ToList();
            }
        }

        #endregion
    }
}
